const mongoose= require('mongoose');
const { modelName } = require("../models/pointsModel")
const exercisesSchema=new mongoose.Schema({
    analysis:String,
    answer:String,
    options:Array,
    pointId:{
        type: mongoose.SchemaTypes.ObjectId,
        ref:modelName
    },
    score:String,
    topics:String
});

mongoose.model('exercisesModel',exercisesSchema,'exercises');

module.exports.modelName='exercisesModel';
module.exports.getAllexercisesModel= async function(){
    return await mongoose.model('exercisesModel').find().populate('pointId');
}